﻿using System;
using System.Collections.Generic;
using ilgolosone.Shared.Domain;

namespace ilgolosone.DomainModel.Entities
{
    [Serializable]
    public class Table : EntityBase
    {
        public virtual TableLocation Location { get; set; }
        public virtual int Places { get; set; }
        public virtual bool Smokers { get; set; }
        public virtual Restaurant Restaurant { get; set; }
        public virtual IList<Reservation> Reservations { get; private set; }

        public Table()
        {
            Smokers = false;
            Reservations = new List<Reservation>();
        }

        public Table(Restaurant restaurant, int places, TableLocation location, bool smokers)
        {
            Restaurant = restaurant;
            Places = places;
            Location = location;
            Smokers = smokers;
            Reservations = new List<Reservation>();
        }

        public override string ToString()
        {
            return string.Format("Tavolo da {0} posti", Places);
        }
    }
}
